/*
 *  Copyright 2011-2012 Redia A/S
 * 
 *  This file is part of Redias Android Utilities.
 *
 *  Redias Android Utilities is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Redias Android Utilities is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with Redias Android Utilities.  If not, see <http://www.gnu.org/licenses/>.
 */
package dk.redia.lib.xmlrpc;

import android.os.AsyncTask;

public class InfoGalleriXmlRpcClient {
		
		private static InfoGalleriXmlRpcClient instance;
		
		public static InfoGalleriXmlRpcClient getInstance() {
			if (instance==null) {
				instance = new InfoGalleriXmlRpcClient();
			}
			return instance;
		}
		
		public InfoGalleriXmlRpcClient() {
		}
		
		public void getAllGalleries(CharSequence customerId, XmlRpcClientResultListener l) {
			InfoGalleriXmlRpcClientCall c = new InfoGalleriXmlRpcClientCall();
			c.resultListener = l;
			c.methodName = "getAllGalleries";
			c.params = new Object[] {
					customerId
			};
			new XmlRpcClientCallTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, c);
		}
		
		public void getGalleryChannels(CharSequence customerId, CharSequence galleryId, XmlRpcClientResultListener l) {
			InfoGalleriXmlRpcClientCall c = new InfoGalleriXmlRpcClientCall();
			c.resultListener = l;
			c.methodName = "getGalleryChannels";
			c.params = new Object[] {
					customerId,
					galleryId
			};
			new XmlRpcClientCallTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, c);
		}
		
		public void getChannelInfoObjects(CharSequence customerId, CharSequence channelId, XmlRpcClientResultListener l) {
			InfoGalleriXmlRpcClientCall c = new InfoGalleriXmlRpcClientCall();
			c.resultListener = l;
			c.methodName = "getChannelInfoObjects";
			c.params = new Object[] {
					customerId,
					channelId
			};
			new XmlRpcClientCallTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, c);
		}
}
